package com.itlong.cloud.operate.service;

import com.itlong.cloud.POJO.DTO.operate.OperateDeviceAuthFileDTO;
import com.itlong.cloud.POJO.VO.operate.DeviceAuthFileVO;
import com.itlong.cloud.utils.page.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      运营-设备白名单授权文件管理服务层接口
 * </desc>
 *
 * @createDate2020/8/13
 **/
public interface IOperateDeviceWhiteListAuthFileService {

    /**
     * <desc>
     *      分页获取授权文件列表
     * </desc>
     *
     * @param operateDeviceAuthFileDTO  授权文件参数DTO
     * @return 授权文件分页列表
     * @Author Zhu.yj
     * @createDate  2020/8/14
     */
    Page<DeviceAuthFileVO> getPage(OperateDeviceAuthFileDTO operateDeviceAuthFileDTO) throws Exception;

    /**
     * <desc>
     *      保存授权文件信息
     * </desc>
     *
     * @param operateDeviceAuthFileDTO 授权文件参数DTO
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/8/14
     */
    Integer save(OperateDeviceAuthFileDTO operateDeviceAuthFileDTO) throws Exception;

    /**
     * <desc>
     *      删除授权文件信息
     * </desc>
     *
     * @param operateDeviceAuthFileDTO 授权文件参数DTO
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/8/14
     */
    Integer delete(OperateDeviceAuthFileDTO operateDeviceAuthFileDTO) throws Exception;

    /**
     *<desc>
     * 获取授权文件信息
     *</desc>
     *
     * @Author  chengshican
     * @Date   2020-08-15 10:44
     * @Param arams 查询参数map
     * @Return 授权文件信息
     * @Exception
     *
     */

    DeviceAuthFileVO getEffectiveAuthFile(OperateDeviceAuthFileDTO operateDeviceAuthFileDTO) throws Exception;

    /**
     *<desc>
     * 根据授权文件id更新可用次数和已使用次数
     *</desc>
     *
     * @Author  chengshican
     * @Date   2020-08-16 9:03
     * @Param  参数请求对象 operateDeviceAuthFileDTO
     * @Return
     * @Exception
     *
     */
    int updateAuthFileByAuthId(OperateDeviceAuthFileDTO operateDeviceAuthFileDTO) throws Exception;

    /**
     * <desc>
     *      获取次数凭证地址
     * </desc>
     *
     * @param authId 授权文件id
     * @return 包含key为 fileName, fileUrl的map的集合
     * @Author Zhu.yj
     * @createDate  2020/8/16
     */
    List<Map<String, Object>> getTimesEvidence(String authId) throws Exception;

    /**
     * <desc>
     *      根据文件名称获取文件数量
     * </desc>
     *
     * @param fileName 文件名称
     * @return 文件名为fileName的数量
     * @Author Zhu.yj
     * @createDate  2020/8/17
     */
    Integer getCountByFileName(String fileName) throws Exception;
}
